﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZGRemote.Server.Core.Models;

namespace ZGRemote.Server.UI.ViewModels
{
    public abstract partial class RemoteViewModelBase : ViewModelBase, IDisposable
    {
        private bool disposedValue;

        public User? User { get; private set; }

        public RemoteViewModelBase(User? user)
        {
            User = user;
        }

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                User = null;
                disposedValue = true;
            }
        }

        ~RemoteViewModelBase()
        {
            Dispose(disposing: false);
        }

        public void Dispose()
        {
            Dispose(disposing: true);
            GC.SuppressFinalize(this);
        }
    }
}
